package com.leetcode.array;

public class Leetcode26 {
    public int removeDuplicates(int[] nums) {
        int k = 0;
        for (int i = 1; i < nums.length ; i ++) {
            if (nums[i] != nums[k]) {
                k ++;
                int temp = nums[i];
                nums[i] = nums[k];
                nums[k] = temp;
            }
        }
        return k;
    }
}
